#{extends 'admintemplate.html'/}
#{set title:'Admin Manager Content'/}
#{set main_title:'Quản lý bài viết'/}
#{set sub_title:'Thêm/xóa/sửa bài viết'/}
#{set current_content:'active'/}
#{set 'moreScripts'}
      #{script 'content.js' /}
      <script src="@{'/public/admin/js/bootstrap-modal.js'}" type="text/javascript"></script>
#{/set}
<div class="span4"><h2>Danh sách những bài viết</h2></div>
<div class="span12">
	#{if contents.size() !=0 }
		<table id="product-table">
		<tr>
			<th class="table-header-check"><a id="toggle-all" ></a> </th>
			<th class="table-header-repeat line-left minwidth-1"><a href="">Id</a>	</th>
			<th class="table-header-repeat line-left minwidth-1"><a href="">Title</a></th>
			<th class="table-header-repeat line-left"><a href="">Alias</a></th>
			<th class="table-header-repeat line-left"><a href="">Category</a></th>
			<th class="table-header-repeat line-left"><a href="">User</a></th>
			<th class="table-header-repeat line-left"><a href="">Date Created</a></th>
			<th class="table-header-repeat line-left"><a href="">Ip Address</a></th>
			<th class="table-header-options line-left"><a href="">Options</a></th>
		</tr>
		#{list items: contents, as:'content'}
			<tr class="content_${content?.id}">
				<td><input  type="checkbox"/></td>
				<td>${content?.id}</td>
				<td>${content?.title}</td>
				<td>${content?.alias}</td>
				<td>${content?.category}</td>
				<td><a href="">${content.user}</a></td>
				<td>${content?.date.format('dd/MM/yyyy hh:mm:ss')}</td>
				<td>${content?.ip}</td>
				<td class="options-width">
				<a href="#" onClick="viewLightBox('${content?.alias}', 'delete', 'deleteContent', ${content?.id})" title="Delete" class="icon-4 info-tooltip">Delete</a>
				<div class="active_${content?.id}">
					<a href="#" onclick="viewLightBox('${content?.alias}', 'deactive', 'deActiveContent', ${content?.id})" title="DeActive" class="icon-5 info-tooltip">Deactive</a>
				</div>
				<div class="deactive_${content?.id}">
					<a href="#" onclick="viewLightBox('${content?.alias}', 'active', 'activeContent', ${content?.id})" title="Active" class="icon-2 info-tooltip">Active</a>
				</div>	
				#{if content?.active}
					<script type="text/javascript">
						divActive = ".active_${content?.id}";
						divDeActive = ".deactive_${content?.id}";
						jQuery(divActive).show();
						jQuery(divDeActive).hide();
					</script>
				#{/if}
				#{else}
					<script type="text/javascript">
						divActive = ".active_${content?.id}";
						divDeActive = ".deactive_${content?.id}";
						jQuery(divActive).hide();
						jQuery(divDeActive).show();
					</script>
				#{/else}
				</td>
			</tr>
		#{/list}
		#{pagination paginationInfo /}
		</table>
	#{/if}
	#{else}
		Không có bài viết nào
	#{/else}
</div>
#{if contents.size() !=0 }
<div id="modal-from-dom" class="modal hide fade">
      <div class="modal-header">
      </div>
      <div class="modal-body">
      </div>
      <div class="modal-footer">
      </div>
</div>
#{/if}